home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 540 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: nntp.hut.fi!nntp!hakola
  2. From: hakola@snakemail.hut.fi (Petri Hakola)
  3. Newsgroups: comp.lang.c
  4. Subject: Binary Tree and MSC/C++7.00
  5. Followup-To: comp.lang.c
  6. Date: 06 Jan 1996 22:28:25 GMT
  7. Organization: Capten Napalm`s Thermonuclear League of Liberty
  8. Distribution: world
  9. Message-ID: <HAKOLA.96Jan7002825@lk-hp-16.hut.fi>
  10. Reply-To: Petri.Hakola@hut.fi
  11. NNTP-Posting-Host: lk-hp-16.hut.fi
  12.  
  13.  
  14.     It seems to me that I suffer some kind of partial amnesia. I
  15.     can build a binary tree, add stuff to it, but how do I destroy
  16.     it. I've tried nearly everyting, but there's either General
  17.     Protection Error or some remains of prior members. I have
  18.     quite embarassing feeling that I have forget something so
  19.     obvious that it should almost 'hit the eye', but...
  20.  
  21.         if(root == NULL)
  22.                   return;
  23.                 delete_tree(root->left);
  24.                   free(root);
  25.         delete_tree(root->right);
  26.  
  27.     Is this correct or ?
  28.  
  29.     And then some problems with strings. Is it common that while
  30.     coding using Microsoft Programmers Workbench, strings aren't
  31.     what they're supposed to be. For examble, if I use strncat to
  32.     cut string from 100 char to 45 char, string is cut, but if I
  33.     print it using printf, first 45 chars come out ok, but rest of
  34.     the string is filled with smiling faces and all sorts of
  35.     'exotic' characters. Like '\0' isn't there or something...
  36.  
  37.     Any suggestions are very welcome, I'm quite stuck with these
  38.     problems of mine.
  39.  
  40.                             - Petri -
  41.